package com.hxit.huaxiamelongarden.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hxit.huaxiamelongarden.domin.po.Favorites;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface FavoritesMapper extends BaseMapper<Favorites> {
    default List<Favorites> selectFavoritesByUserId(Integer userId){
        LambdaQueryWrapper<Favorites> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(Favorites::getUserId,userId);
        return selectList(queryWrapper);
    }
}
